<div style="float:right; margin-top: 10px;">
	<p>Date: <input type="text" id="datepicker" value="{$date}" />
	   <button value="view" id="View">View</button>
	</p>
	{ if ($dateDownload != "") }
		<p><a href="{$smarty.const.HOST_ADMIN}/common/download/?filename=dailyreport_{$dateDownload}.xls&p=/data/dailyreport">Click here</a> to download</p>
    {/if}
</div>
<div>
	{$str}
</div>
{literal}
<script>
	$(function() {
        $( "#datepicker" ).datepicker();
    });

	$("#View").click(function () {
	
	    var date = $("#datepicker").val();
		var strDate = date.split("/");
		
		var d = strDate[1] + strDate[0] + strDate[2];

		$("#body").html("Loading ...");

        $.ajax({
            type: "GET",
            url: host + "/inventory/dailyreport/index?d=" + d + "&dreturn=" + date,
            success: function (data) {
                $("#body").html(data);
            }
        });
    });
</script>
{/literal}